//
//  DetailViewController.h
//  DSApp
//
//  Created by Vladimir Aguilar on 2011-09-27.
//  Copyright 2011 Hem. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
#import <MobileCoreServices/MobileCoreServices.h>

@class RootViewController;

@interface DetailViewController : UIViewController 
<UINavigationControllerDelegate,UIPopoverControllerDelegate, UISplitViewControllerDelegate,UITextFieldDelegate, UIImagePickerControllerDelegate, UISearchBarDelegate> {
    
    UIPopoverController *popoverController;
    UIToolbar *toolbar;
    
    NSManagedObject *detailItem;
    UILabel *detailDescriptionLabel;
	UILabel *titleLabel;
	
	//Customer Information
	UITextField *name;
	UITextField *surName;
	UITextField *address;
	UITextField *phoneNr;
	UIImageView *customerPhoto;


	UITextField *tempEdit;

	UIBarButtonItem *cameraRollBtn;
	UIBarButtonItem *saveBtn;
	UISearchBar *searchBar;
	
	BOOL newMedia;
	
    RootViewController *rootViewController;
}

@property (nonatomic, retain) IBOutlet UIToolbar *toolbar;

@property (nonatomic, retain) NSManagedObject *detailItem;
@property (nonatomic, retain) IBOutlet UILabel *detailDescriptionLabel;

@property (nonatomic, retain) IBOutlet UITextField *name;
@property (nonatomic, retain) IBOutlet UITextField *surName;
@property (nonatomic, retain) IBOutlet UITextField *address;
@property (nonatomic, retain) IBOutlet UITextField *phoneNr;
@property (nonatomic, retain) IBOutlet UIImageView *customerPhoto;

@property (nonatomic, retain) IBOutlet UIBarButtonItem *cameraRollBtn;
@property (nonatomic, retain) IBOutlet UIBarButtonItem *saveBtn;
@property (nonatomic, retain) IBOutlet UISearchBar *searchBar;




@property (nonatomic, retain) UILabel *titleLabel;


@property (nonatomic, assign) IBOutlet RootViewController *rootViewController;
@property (nonatomic, retain) UIPopoverController *popoverController;


//Button action listners
- (IBAction)insertNewObject:(id)sender;
- (IBAction)saveChanges:(id)sender;

//-(IBAction)takePhoto:(id)sender;
-(IBAction)useSavedPhotos;
- (void)configureView;
- (void) saveData;
- (void) findContact;






@end
